package org.nearby.note;

import java.awt.Color;
import java.awt.Component;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class settings extends JFrame {
	public settings(){
		initWin();
		initBind();
	}
	//初始化界面
	public void initWin(){
		
	}
	//初始化事件绑定
	public void initBind(){
		GridLayout grid1 = new GridLayout(1, 2, 20, 0);
		this.setLayout(grid1);
		Component jp1 = setting_group_one();
		Component jp2 = setting_group_two();
		Component jp3 = setting_group_three();
		
		JTabbedPane tabs = new JTabbedPane();
		tabs.addTab("设置一", null, jp1, "第一个设置");
		tabs.addTab("设置二", null, jp2, "第二个设置");
		tabs.addTab("设置三", null, jp3, "第三个设置");
		tabs.setSelectedIndex(1);
		
		add(tabs);
		
		this.setTitle("设置");
		this.setSize(600, 500);
		this.setLocationRelativeTo(null);
		this.setVisible(true);
	}
	public Component setting_group_one(){
		JPanel jp = new JPanel(false);
		JLabel label = new JLabel("第一个设置");
		jp.add(label);
		return jp;
	}
	public Component setting_group_two(){
		JPanel jp = new JPanel(false);
		jp.setLayout(new GridLayout(1,1));
		JLabel label = new JLabel("第二个设置");
		label.setHorizontalAlignment(JLabel.CENTER);
		jp.add(label);
		return jp;
	}
	public Component setting_group_three(){
		JPanel jp = new JPanel(false);
		JLabel label = new JLabel("第三个设置");
		jp.add(label);
		return jp;
	}
}
